package main

import "fmt"

func main() {
	slice := []int{1, 2}
	fmt.Printf("%v %d %d\n", slice, len(slice), cap(slice))
	slice = append(slice, 1, 2, 3)
	fmt.Printf("%v %d %d\n", slice, len(slice), cap(slice))
	for i := 0; i < 20; i++ {
		slice = append(slice, i)
		fmt.Printf("%v %d %d\n", slice, len(slice), cap(slice))
	}
}

// cap = 2 + 3 = 5
// old.cap = 2
// doubleCap = 4
// doubleCap < cap
// newCap = 5
// 5*8 = 40
// 比40大的最小块为48
// 48/8 = 6
